Imports System.ComponentModel
Imports System.Web.UI

<ToolboxData("<{0}:FirstSample runat=server></{0}:FirstSample>")> Public Class FirstSample
    Inherits System.Web.UI.WebControls.WebControl
    Dim _BookTitle As String = "*"

    Protected Overrides Sub CreateChildControls()
        Dim lbl As New System.Web.UI.WebControls.Label
        Dim lblBook As New System.Web.UI.WebControls.Label

        Dim tbl As New System.Web.UI.WebControls.Table
        Dim tc(1) As System.Web.UI.WebControls.TableCell
        Dim tr(1) As System.Web.UI.WebControls.TableRow

        tc(0) = New System.Web.UI.WebControls.TableCell
        tc(1) = New System.Web.UI.WebControls.TableCell
        tr(0) = New System.Web.UI.WebControls.TableRow
        tr(1) = New System.Web.UI.WebControls.TableRow
        tr(0).Cells.Add(tc(0))
        tr(1).Cells.Add(tc(1))
        tbl.Rows.Add(tr(0))
        tbl.Rows.Add(tr(1))

        lbl.Text = "Title:"
        lblBook.Text = _BookTitle
        lblBook.Font.Bold = True
        lblBook.BorderColor = System.Drawing.Color.Black
        lblBook.BorderStyle = WebControls.BorderStyle.Solid
        lblBook.BorderWidth = 1

        tc(0).Controls.Add(lbl)
        tc(1).Controls.Add(lblBook)

        Me.Controls.Add(tbl)
    End Sub

    <WebControls.WebParts.WebBrowsable(True), _
     WebControls.WebParts.Personalizable(WebControls.WebParts.PersonalizationScope.Shared)> _
    Property BookTitle() As String
        Get
            Return _BookTitle
        End Get
        Set(ByVal value As String)
            _BookTitle = value
        End Set
    End Property

End Class
